/**
 * 页面面板组件的样式
 * 确保与网页样式隔离
 * iOS风格设计
 */

.nav-panel-container {
  --webpage-summary-panel-width: 320px;
  --webpage-summary-panel-background: #ffffff;
  --primary-color: #007aff; /* iOS蓝色 */
  --primary-hover: #0062cc;
  --error-color: #ff3b30; /* iOS红色 */
  --success-color: #34c759; /* iOS绿色 */
  --border-color: #e5e5ea; /* iOS浅灰色边框 */
  --active-color: #e8f4fd;
  --ios-text-color: #333333;
  --ios-secondary-text: #8e8e93;
  
  all: initial; /* 重置所有样式 */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ios-text-color);
  position: fixed;
  width: var(--webpage-summary-panel-width);
  background-color: var(--webpage-summary-panel-background);
  border-radius: 14px; /* iOS圆角 */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  height: fit-content;
  /* 位置现在由JS控制 */
  /* top: var(--webpage-summary-panel-top, 80px); */
  /* right: var(--webpage-summary-panel-right, 20px); */
  transform: scale(var(--webpage-summary-calc-scale, 1));
  transform-origin: top right;
  z-index: 2147483647; /* 最高级别 */
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  transition: width 0.2s, height 0.2s;
  overflow: hidden;
  resize: none; /* 禁用原生resize */
}

/* 所有子元素都使用 box-sizing: border-box */
.nav-panel-container * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 面板头部 */
.nav-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(248, 248, 248, 0.8); /* iOS淡灰色背景 */
  border-radius: 14px 14px 0 0;
  color: var(--ios-text-color);
  cursor: move; /* 指示可拖动 */
}

.nav-panel-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  user-select: none; /* 防止拖动时选中文本 */
}

.nav-panel-actions {
  display: flex;
  gap: 8px;
}

/* 工具栏 */
.nav-panel-tools {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  background-color: #ffffff;
}

/* 操作按钮容器 */
.nav-panel-action-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  width: 100%;
  align-items: center;
}

.nav-panel-search {
  width: 100%;
}

.nav-panel-input {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 10px; /* iOS输入框圆角 */
  font-size: 14px;
  background-color: #f2f2f7; /* iOS输入框背景色 */
}

.nav-panel-export {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.nav-panel-select {
  padding: 8px 12px;
  border: none;
  border-radius: 10px; /* iOS下拉框圆角 */
  background-color: #f2f2f7; /* iOS下拉框背景色 */
  font-size: 14px;
  color: var(--ios-text-color);
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%238e8e93' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

/* 按钮样式 */
.nav-panel-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px; /* iOS按钮圆角 */
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.nav-panel-btn:hover {
  background-color: var(--primary-hover);
}

.nav-panel-close-btn {
  background: none;
  border: none;
  color: var(--ios-secondary-text);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.nav-panel-close-btn:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.05);
}

/* 信息栏 */
.nav-panel-info {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--ios-secondary-text);
  border-bottom: 1px solid var(--border-color);
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 信息栏操作按钮区域 */
.nav-panel-info-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* 图标按钮样式 */
.nav-panel-icon-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ios-secondary-text);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.nav-panel-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary-color);
}

.nav-panel-icon-btn:active {
  background-color: rgba(0, 122, 255, 0.15);
  transform: scale(0.95);
}

/* 点击反馈效果 */
.nav-panel-icon-btn.feedback-active {
  background-color: rgba(0, 122, 255, 0.2);
  color: var(--primary-color);
  transform: scale(1.1);
}

/* 迷你选择框 */
.nav-panel-mini-select {
  padding: 4px 20px 4px 8px;
  border: none;
  border-radius: 6px;
  background-color: #f2f2f7;
  font-size: 12px;
  color: var(--ios-text-color);
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24'%3E%3Cpath fill='%238e8e93' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 80px;
}

.nav-panel-mini-select:hover {
  background-color: #e5e5ea;
}

.nav-panel-mini-select:focus {
  outline: none;
  background-color: rgba(0, 122, 255, 0.1);
}

/* 内容区域 */
.nav-panel-content {
  padding: 0;
  overflow-y: auto;
  flex-grow: 1;
  background-color: #ffffff;
  scrollbar-width: thin;
}

.nav-panel-content::-webkit-scrollbar {
  width: 6px;
}

.nav-panel-content::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

/* 表格样式 */
.nav-panel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.nav-panel-table th,
.nav-panel-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.nav-panel-table th {
  background-color: rgba(248, 248, 248, 0.8);
  position: sticky;
  top: 0;
  z-index: 10;
  font-weight: 600;
  color: var(--ios-secondary-text);
}

.nav-panel-table tr:hover {
  background-color: #f2f2f7;
}

.nav-panel-active-link {
  background-color: rgba(0, 122, 255, 0.1);
}

.nav-panel-link {
  color: var(--primary-color);
  text-decoration: none;
  display: block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-panel-link:hover {
  text-decoration: underline;
}

/* 空状态 */
.nav-panel-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--ios-secondary-text);
  font-size: 15px;
}

/* 页脚 */
.nav-panel-footer {
  padding: 10px 16px;
  font-size: 11px;
  color: var(--ios-secondary-text);
  border-top: 1px solid var(--border-color);
  text-align: center;
  border-radius: 0 0 14px 14px;
  background-color: rgba(248, 248, 248, 0.8);
}

/* 调整大小的手柄 */
.nav-panel-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  z-index: 10;
}

.nav-panel-resize-handle::before {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ios-secondary-text);
  border-bottom: 2px solid var(--ios-secondary-text);
  opacity: 0.6;
}

/* 拖拽和调整大小时的样式 */
.nav-panel-container.dragging {
  opacity: 0.9;
  transition: none;
}

.nav-panel-container.resizing {
  transition: none;
} 